<?php
/*
 * This is a convenience script used for building packages.
 * requires PEAR_PackageFileManager (sudo pear install PEAR_PackageFileManager)
 * 
 * I stole this from somewhere and I'm sorry for not linking back...
 * 
 */
$options = array(
  'package' => 'rhRimDataModelPlugin',
  'channel' => 'pear.stemos.com',
  'summary' => 'Test',
  'description' => 'Description Test',
  'baseinstalldir' => 'rhRimDataModelPlugin',
  'version' => '0.0.1',
  'packagedirectory' => '/home/rscarriere/projects/radhealth/plugins/rhRimDataModelPlugin',
  'state' => 'alpha',
  'filelistgenerator' => 'file',
  'notes' => 'Alpha Release -- first attempt at PEAR package.' // generate from cvs, use file for directory
  );

require_once('PEAR/PackageFileManager2.php');
 $packagexml = new PEAR_PackageFileManager;
 $e = $packagexml->setOptions($options); // same for the license
 if (PEAR::isError($e)) {
     echo $e->getMessage();
     die();
 }
$packagexml->addRole('pkg', 'doc'); // add a new role mapping
 if (PEAR::isError($e)) {
     echo $e->getMessage();
     exit;
 }
$packagexml->addMaintainer('rscarriere', 'lead', 'Robin Carriere', 'rscarriere@stemos.com');
 // note use of debugPackageFile() - this is VERY important
 if (isset($_GET['make']) || $_SERVER['argv'][1] == 'make') {
     $e = $packagexml->writePackageFile();
 } else {
     $e = $packagexml->debugPackageFile();
 }
 if (PEAR::isError($e)) {
     echo $e->getMessage();
     die();
 }
?>